package base

import (
	"github.com/zeromicro/go-queue/kq"
	"payme3000/framework/config_center"
)

type (
	// IProducer 消息队列消费者模块
	IProducer interface {
		IModule
		ISetConfigCenter

		placeholderProducer()
	}

	// Producer IProducer的基础实现
	Producer struct {
		Module

		Topic   string     // 唯一标识
		Brokers []string   // 连接地址
		Pusher  *kq.Pusher // go-zero kq生产者

		ConfigCenter *config_center.ConfigCenter // 配置中心
	}
)

// SetConfigCenter 依赖配置中心构建生产者
func (p *Producer) SetConfigCenter(configCenter *config_center.ConfigCenter) {
	p.ConfigCenter = configCenter
}

func (p *Producer) placeholderProducer() {}
